package com.duan.dao.user;

import com.duan.pojo.Role;
import com.duan.pojo.User;
import com.duan.util.Constants;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    //获得登录的用户信息
    public User loginDao(Connection connection, String userCode) throws SQLException;

    //修改当前用户密码
    public int updatePwd(Connection connection, int id, String password) throws SQLException;

    //根据用户名，或者角色查询用户总数
    public int numOfUser(Connection connection, String userName, int userRole) throws SQLException;

    //获取用户列表
    public List<User> getUserList(Connection connection, String userName, int userRole, int currentPageNo, int pageSize) throws Exception;

    //增加用户
    public int insertUser(Connection connection, User user) throws SQLException;

    //查询userCode存在的用户
    public User selectUserCodeExist(Connection connection, String userCode) throws SQLException;

    //删除指定用户
    public int deleteUser(Connection connection, int userid) throws SQLException;

    //获取指定id用户
    public User selectUserByid(Connection connection, int id)throws SQLException;

    //修改指定用户信息
    public int modify(Connection connection, User user) throws Exception;
}
